//
//  PreferenceController.h
//  FlickrImport
//
//  Created by Sandeep Chayapathi on 1/8/08.
//  Copyright 2008 __MyCompanyName__. All rights reserved.
//

#import <Cocoa/Cocoa.h>
#import <ObjectiveFlickr/ObjectiveFlickr.h>

extern NSString *MEFlickrFrob;
extern NSString *MEFlickrToken;
extern NSString *MEFlickrUserName;
extern NSString *MEFlickrUserId;

@interface PreferenceController : NSWindowController {
    OFFlickrContext *context;
    OFFlickrInvocation *invoc;
    
    NSString *api_key;
    NSString *shared_secret;
    
    NSString *frob;
    NSString *token;
    
    IBOutlet NSButton *authenticate;
    IBOutlet NSButton *tokenButton;
    IBOutlet NSTextField *tokenTitle;
}

- (IBAction) authenticate:(id)sender;
- (IBAction) authenticateToken:(id)sender;

- (NSString *) frob;
- (void) frob: (NSString *) str;
- (NSString *) token;
- (void) token: (NSString *) d;

- (void)flickrInvocation:(OFFlickrInvocation*)invocation didFetchData:(NSXMLDocument*)xmldoc;
- (void)flickrInvocation:(OFFlickrInvocation*)invocation errorCode:(int)errcode errorInfo:(id)errinfo;
- (void) getFrob;
- (void) getToken;
- (void) getFrob: (NSXMLDocument*)xmldoc;
- (void) getToken: (NSXMLDocument*)xmldoc;
@end
